package com.swordget.service.impl;

import com.swordget.dao.LogDao;
import com.swordget.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

/**
 * @Author: David
 * @Date: Created in 15:57 2021/2/25
 * @Description: 日志实现
 * @Modified By:
 * @Version:
 */

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogDao logDao;


    @Override
    public void addLog(String loginId, String content, String type, String org) {
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
        logDao.addLog(id, loginId, content, type, org, time);
    }
}
